#!/bin/bash
# Copyright (c) 2020 Presto Labs Pte. Ltd.
# Author: donggu
set -e

source ~/miniconda3/etc/profile.d/conda.sh
conda activate coin2_env

echo '# ---------------------------------------------------------------------------- #'
echo '#                                    Clang 10                                  #'
echo '# ---------------------------------------------------------------------------- #'
./build-clang.sh

echo '# ---------------------------------------------------------------------------- #'
echo '#                                coin_test_data                                #'
echo '# ---------------------------------------------------------------------------- #'
ssh-keygen -F gitea.prestolabs.io || ssh-keyscan gitea.prestolabs.io >> ~/.ssh/known_hosts
git lfs install --skip-repo
git clone git@gitea.prestolabs.io:prestolabs/coin_test_data.git ../coin_test_data


echo '# ---------------------------------------------------------------------------- #'
echo '#                                    doctest                                   #'
echo '# ---------------------------------------------------------------------------- #'

./bazel-bin/cc/coin2/test

echo '# ---------------------------------------------------------------------------- #'
echo '#                                     gtest                                    #'
echo '# ---------------------------------------------------------------------------- #'

./bazel-bin/cc/testcoin2/testcoin2
